import request from '@/utils/request'
import type {Book, User} from "@/api/book";
export interface Collect {
  uid: string
  bid: number
  createTime: string
  user: User | null
  book: Book | null
}
export const getCollectList = (uId: string) => {
  return request<{uId: string},null,Collect[]>('/collect/list', 'GET',{ data: { uId}})
}
export interface InsertCollectParam {
  uid: string
  bid: number
}
export const postInsertCollect = (data: InsertCollectParam) => {
  return request<InsertCollectParam,null,Collect>('/collect/insert', 'POST', { data })
}
export interface CollectDeleteParam {
  uId: string
  bids: string
}
export const postDeleteCollect = (param: CollectDeleteParam) => {
  return request<null,CollectDeleteParam,Collect>('/collect/delete/{uId}/{bids}', 'DELETE', { repObj: param })
}